﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KandaAlpha.Domain.Repository;
using KandaAlpha.Application.Interfaces;

namespace KandaAlpha.Application.Impl
{
    public class UnitOfWork : IUnitOfWork, IDisposable
    {
        private IRepositoryContext _repositoryContext;

        public UnitOfWork(IRepositoryContext repositoryContext)
        {
            _repositoryContext = repositoryContext;
        }

        public void Commit()
        {
            _repositoryContext.SaveChanges();
        }

        public void Dispose()
        {
            // TODO decide if we should auto commit here?
        }

    }
}
